// TypeScript file
class locationBg1 extends eui.Component{

    private tx_name1:eui.Label;
    private tx_xy1:eui.Label;
    private mask1:eui.Image;

    private tx_name2:eui.Label;
    private mask2:eui.Image;
    private tx_xy2:eui.Label;
    
    private imagethis:eui.Image;
    private tx_namethis:eui.Label;
    private maskthis:eui.Image;

    private _data:any;

	public constructor(userData) {//(用户1数据,用户2数据);
		super();
        this._data = userData;
        this.addEventListener(eui.UIEvent.COMPLETE,this.onComplete,this);
		this.skinName = "src/Game/gameRoom/location/locationBg1Skin.exml";				
	}
	private onComplete():void{
        if(this._data&&this._data.length == 2){
            var data1:any = this._data[0];
            var data2:any = this._data[1];

            this.tx_namethis.text = StringOmit.getChar(data1.user1.name,8);
            var icothis:loadImage = new loadImage(data1.user1.headUrl,this.maskthis.width); 
            icothis.x = this.maskthis.x;
            icothis.y = this.maskthis.y; 
            this.addChild(icothis); 
            icothis.mask = this.maskthis;


            this.tx_name1.text = StringOmit.getChar(data1.user2.name,8);
            this.tx_xy1.text = data1.desc; 
            var ico1:loadImage = new loadImage(data1.user2.headUrl,this.mask1.width); 
            ico1.x = this.mask1.x;
            ico1.y = this.mask1.y; 
            this.addChild(ico1); 
            ico1.mask = this.mask1;

            this.tx_name2.text = StringOmit.getChar(data2.user2.name,8);
            this.tx_xy2.text = data2.desc; 
            var ico2:loadImage = new loadImage(data2.user2.headUrl,this.mask2.width); 
            ico2.x = this.mask2.x;
            ico2.y = this.mask2.y; 
            this.addChild(ico2); 
            ico2.mask = this.mask2;
        }
	}
}